//
//  BCHomeDataRequest.m
//  GSBlockChain
//
//  Created by guoshikeji_a on 2018/12/3.
//  Copyright © 2018 guoshikeji. All rights reserved.
//

#import "BCHomeDataRequest.h"

@implementation BCHomeDataRequest
/**
 固定参数
 */
- (NSString *)os {
    NSString *systemName = [GeneralParameterManager sharedGeneral].deviceSystemName;
    NSString *deviceSystemVersion = [GeneralParameterManager sharedGeneral].deviceSystemVersion;
    //
    return [NSString stringWithFormat:@"%@ %@",systemName,deviceSystemVersion];
}
- (NSString *)phone {
    return @"Apple";
}
- (NSString *)height {
    return [NSString stringWithFormat:@"%.0f",ScreenHeight];
}
- (NSString *)width {
    return [NSString stringWithFormat:@"%.0f",ScreenWidth];
}
- (NSString *)mobile {
    NSString *deviceModel = [GeneralParameterManager sharedGeneral].deviceModel;
    return deviceModel;
}
- (NSString *)uuid {
    return [GeneralParameterManager sharedGeneral].uuid;
}
- (NSString *)device_type {
    return @"2";
}
//
- (HttpRequestMethod)requestMethod {
    return PUT;
}
- (NSString *)relativelyUrl {
    return V1_Flow_Index;
}

- (BOOL)success:(NSURLSessionDataTask *)task data:(id)obj {
    BOOL success = [super success:task data:obj];
    if (success) {
        BCHomeDataResponse *resp = [BCHomeDataResponse yy_modelWithJSON:obj];
        if (self.requestSuccessed) {
            self.requestSuccessed(resp, nil);
        }
    }
    return success;
}

@end
